package com.cognizant.app.ui.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;

import com.cognizant.app.R;
import com.cognizant.app.ui.activity.QRCodeScanActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

public class ScanFragment extends Fragment {
    private static String TAG = ScanFragment.class.getName();
    private Unbinder unbinder;
    @BindView(R.id.scan)
    ImageButton scan;
    @Override
    public View onCreateView(LayoutInflater inflater,
                             ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.view_pager_scan, null);
        unbinder = ButterKnife.bind(this,view);

        return view;

    }

    @OnClick(R.id.scan)
    public void scan(){
        startActivity(new Intent(getActivity(), QRCodeScanActivity.class));
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }
}